﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XPathPlugin.XPathTreeUtils
{
    class XPathValue
    {       
        #region Variables

        private string _value;
        private string _debug;
        private NodeType _type;
        private JoinType _joinType;

        #endregion

        #region Enums
        
        public enum NodeType
        {            
            Expression,            
            Filter,
            FilterInside            
        }

        public enum JoinType
        {
            Default,
            Union,
            And,
            Or
        }

        #endregion

        public XPathValue(string value, NodeType type)
        {
            _value = value;
            _type = type;
            _debug = "";
            _joinType = JoinType.Default;
        }

        public XPathValue(string value, NodeType type, string debug)
            : this(value, type)
        {
            _debug = debug;            
        }

        public XPathValue(string value, NodeType type, JoinType joinType, string debug)
            : this(value, type, debug)
        {
            _joinType = joinType;
        }
        
        #region Properties

        /// <summary>
        /// Gets or sets value string
        /// </summary>
        public string Value
        {
            get { return _value; }
            set { _value = value; }
        }

        /// <summary>
        /// Gets or sets debug string
        /// </summary>
        public string Debug
        {
            get { return _debug; }
            set { _debug = value; }
        }

        /// <summary>
        /// Gets or sets node type
        /// </summary>
        public NodeType Type
        {
            get { return _type; }
            set { _type = value; }
        }

        /// <summary>
        /// Gets or sets join type
        /// </summary>
        public JoinType TypeOfJoin
        {
            get { return _joinType; }
            set { _joinType = value; }
        }
      
        #endregion
    }
}
